<template>
  <el-tooltip effect="dark" content="文本颜色" placement="top-start">
    <div ref="color_picker" class="el-tiptap-editor__command-button">
      <svg
        aria-hidden="true"
        width="11"
        height="16"
        viewBox="0 0 352 512"
        focusable="false"
        class="fa-icon"
      >
        <g>
          <path
            d="M205.2 22.1c47 158.5 146.8 200.1 146.8 311.8 0 98.4-78.7 178.1-176 178.1s-176-79.7-176-178.1c0-111.2 100-154.1 146.8-311.8 9-30.1 50.5-28.8 58.4 0zM176 448c8.8 0 16-7.2 16-16s-7.2-16-16-16c-44.1 0-80-35.9-80-80 0-8.8-7.2-16-16-16s-16 7.2-16 16c0 61.8 50.3 112 112 112z"
          ></path>
        </g>
      </svg>
    </div>
  </el-tooltip>
</template>
<script>
import Colorpicker from "@/components/ElTipTapRichText/lib/ColorPicker.js";
export default {
  mounted() {
    Colorpicker.create({
      el: this.$refs.color_picker,
      poperClass: "app_color_picker",
      change: (hex) => {
        this.$emit("change", hex);
      },
    });
  },
};
</script>